package PushToPhone;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.regex.Pattern;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.TitledBorder;

import utils.BasePanel;
import utils.Centrer;
import utils.lignOptions;
import utils.variable;

import Window.Fenetre;

public class PhoneReset extends BasePanel
	{
	/************
	 * Variables
	 ***********/
	PhoneResetProcess monProcess;
	Fenetre maFenetre;
	String[] tabOption;
	public ArrayList<lignOptions> optionList;
	JCheckBox selectAll;
	
	/****************
	 * Constructeurs
	 ****************/
	public PhoneReset(Fenetre maFenetre)
		{
		/*************
		 * Variables
		 *************/
		tabOption = new String[]{"restart","Reset","Hard Reset"};
		utils.variable.setOptions(new boolean[tabOption.length]);
		optionList = new ArrayList<lignOptions>();
		selectAll = new JCheckBox("Check all");
		
		//Fill option ArrayList
		for(int i=0;i<tabOption.length;i++)
			{
			optionList.add(new lignOptions(tabOption[i]));
			}
		
		//Panneaux		
		choixOptions.setLayout(new GridLayout(1,5));
		
		//Events
		monProcess = new PhoneResetProcess(this);
		launch.addActionListener(monProcess);
		selectAll.addActionListener(monProcess);
		
		
		for(int i=0;i<optionList.size();i++)
			{
			if(Pattern.matches("Reset", optionList.get(i).getNom()))
				{
				optionList.get(i).getBobox().setSelected(true);
				}
			choixOptions.add(optionList.get(i));
			optionList.get(i).getBobox().addActionListener(monProcess);
			}
		
		selectAll.setVisible(false);
		Vccm.setVisible(false);
		Cversion.setVisible(false);
		panneau.add(selectAll);
		}
	
	/****************************************
	 * Method used to select or deselect all
	 * the options check box 
	 ****************************************/
	public void optionSelectAll(boolean bool)
		{
		for(int i=0;i<optionList.size();i++)
			{
			optionList.get(i).getBobox().setSelected(bool);
			}
		}
	
	/*2012*//*RATEL Alexandre 8)*/
	}
